#ifndef Vector3H
#define Vector3H

#include <iostream>


// Vector3
class Vector3
{
public:

	static const unsigned int ELEMENTCOUNT = 3;
	static const float        EQUALLIMIT;
	static const Vector3      ZERO;
	static const Vector3      UNIT_X;
	static const Vector3      UNIT_Y;
	static const Vector3      UNIT_Z;

	union
	{
		float mElement[ELEMENTCOUNT];
		struct
		{
			float mX;
			float mY;
			float mZ;
		};
	};

	 Vector3();
 	 Vector3( const Vector3& v );
	 Vector3( float x, float y, float z );
	 Vector3( const float data[ELEMENTCOUNT] );
	 Vector3( const int   data[ELEMENTCOUNT] );
	~Vector3();

	float          operator [] ( unsigned int i ) const;
	float&         operator [] ( unsigned int i );
	const Vector3& operator +  () const;
	Vector3        operator -  () const;
	Vector3        operator +  ( const Vector3& v ) const;
	Vector3        operator -  ( const Vector3& v ) const;
	Vector3        operator *  ( float s ) const;
	Vector3        operator /  ( float s ) const;
	Vector3&       operator =  ( const Vector3& v );
	Vector3&       operator += ( const Vector3& v );
	Vector3&       operator -= ( const Vector3& v );
	Vector3&       operator *= ( float s );
	Vector3&       operator /= ( float s );
	bool           operator == ( const Vector3& v ) const;
	bool           operator != ( const Vector3& v ) const;

	float    Dot( const Vector3& v ) const;
	float    GetSquaredLength() const;
	float    GetLength() const;
	Vector3& Normalize();

};

Vector3 operator * ( float s, const Vector3& v );

std::ostream& operator << ( std::ostream& o, const Vector3& v );


#endif
